import React from 'react'
import store from '../../store/store'
import {movieActions} from '../../store/actions/movieActions'

export default function Movie (){
    const {count}= store.getState().count
    const getMovieListHandle =()=>{
           store.dispatch(movieActions())
    }
    const {movieList} =store.getState().movie
    return( 
        <div>
            <h1>我是Movie组件,我用的是count组件中的{count}</h1>
            <button onClick={getMovieListHandle}>获取电影信息</button>
            <ul>
                {
                    movieList.map((item)=>{
                            return <li key={item.tvId}>{item.albumName}</li>
                    })
                }
            </ul>
        </div>
    )
}